package com.nuc.bigdata.controller;

import com.nuc.bigdata.orm.entity.User;
import com.nuc.bigdata.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author JackLuo
 * @date 2019/11/21
 */
@RestController
@RequestMapping("/oa-user")
public class UserController {

    private final UserService userService;

    @Autowired
    UserController(UserService userService){
        this.userService = userService;
    }

    @GetMapping("/{userId}")
    public User queryByUserId(@PathVariable("userId")String userId){
        User user = userService.queryByUserId(userId);
        return user;
    }
}
